import { configureStore } from '@reduxjs/toolkit';
import knowledgeBaseReducer from './slices/knowledgeBase';
import documentReducer from './slices/document';
import qaReducer from './slices/qa';

// 配置Redux store
export const store = configureStore({
  reducer: {
    knowledgeBase: knowledgeBaseReducer,
    document: documentReducer,
    qa: qaReducer,
  },
  // 开发环境启用Redux DevTools
  devTools: process.env.NODE_ENV !== 'production',
});

// 从store本身推断类型
export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch; 